package com.ehotting.edsta.diagnosisPredict.feign;

import com.ehotting.eaf.core.web.domain.diagnosisPredict.PageDto;
import com.ehotting.eaf.core.web.domain.diagnosisPredict.Response;
import com.ehotting.edsta.diagnosisPredict.domain.dto.FeCanvas;
import com.ehotting.edsta.diagnosisPredict.feign.factory.FeCanvasFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 特征画布FeignClient
 */
@FeignClient(name = "feCanvas", url = "${request.url.prefix}/feCanvas", fallbackFactory = FeCanvasFallbackFactory.class)
public interface FeCanvasFeignService {

    /**
     * 根据id批量删除,逗号分隔ps:1,2,3，关联子表删除请重写
     *
     * @return
     */
    @PostMapping(value = "/deleteByIds")
    Response<String> deleteByIds(@RequestParam("ids") String ids);

    /**
     * 根据id查询
     *
     * @return
     */
    @GetMapping(value = "/getById")
    Response<FeCanvas> getById(@RequestParam("id") Long id);

    /**
     * 列表
     *
     * @return
     */
    @GetMapping(value = "/list")
    Response<List<FeCanvas>> list(@RequestParam("createTime") String createTime,
                                  @RequestParam("creater") String creater,
                                  @RequestParam("explains") String explains,
                                  @RequestParam("id") Long id,
                                  @RequestParam("iteminfoId") String iteminfoId,
                                  @RequestParam("itemname") String itemname,
                                  @RequestParam("name") String name);

    /**
     * 特征画布字段列表列表
     *
     * @return
     */
    @GetMapping(value = "/pageList")
    Response<PageDto<FeCanvas>> pageList(@RequestParam("createTime") String createTime,
                                         @RequestParam("creater") String creater,
                                         @RequestParam("explains") String explains,
                                         @RequestParam("id") Long id,
                                         @RequestParam("iteminfoId") String iteminfoId,
                                         @RequestParam("itemname") String itemname,
                                         @RequestParam("name") String name,
                                         @RequestParam("page") Long page,
                                         @RequestParam("pageSize") Long pageSize);

    /**
     * 特征画布字段列表保存
     *
     * @return
     */
    @PostMapping(value = "/save")
    Response<FeCanvas> save(@RequestBody FeCanvas feCanvas);

    /**
     * 根据数据的id修改或不存在id就添加
     *
     * @return
     */
    @PostMapping(value = "/saveOrUpdate")
    Response<String> saveOrUpdate(@RequestBody FeCanvas t);

    /**
     * 根据数据的id批量修改或不存在id就批量添加
     *
     * @return
     */
    @PostMapping(value = "/saveorUpdateBatch")
    Response<String> saveorUpdateBatch(@RequestBody FeCanvas[] t);

    /**
     * 修改
     *
     * @return
     */
    @PostMapping(value = "/update")
    Response<String> update(@RequestBody FeCanvas t);

    /**
     * 根据数据的id批量修改
     *
     * @return
     */
    @PostMapping(value = "/updateList")
    Response<String> updateList(@RequestBody FeCanvas[] t);


}
